package com.mdxq.mall.response;

import lombok.Data;

@Data
public class R {
    private int code;
    private String message;
    private Object data;

    private R (){}

    private R(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static  R ok(Object data){
        R r=new R(200,"操作成功",data);
        return r;
    }
    public static R error(){
        R r=new R(500,"操作失败",null);
        return r;
    }
}
